from django.contrib.auth.forms import UserChangeForm as OldUserChangeForm
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm as OldUserCreationForm
from django.utils.translation import ugettext_lazy as _

from django import forms

class UserCreationForm(OldUserCreationForm):
    username = forms.EmailField(label=_("Username"), max_length=30, 
        help_text = _("Required. 30 characters or fewer. Valid e-mail address"))

class UserChangeForm(OldUserChangeForm):
    username = forms.EmailField(label=_("Username"), max_length=30, 
        help_text = _("Required. 30 characters or fewer. Valid e-mail address"))

    class Meta:
        model = User
        exclude = ('email',)